﻿
<%template _header%>
<%namespace YouHP.Model%>
<%namespace YouHP.Model.Group%>
<%namespace YouHP.Utility%>
<script type="text/javascript">
		var curtab = "location";
		function swapTab(tab)
		{

			 var ctrl = _$("ui-" + curtab);
			 ctrl.style.display = 'none';
			 ctrl = _$("ui-" + tab);
			 ctrl.style.display = 'block';
			 curtab = tab;
			
		}
		
		
		
        function checkform()
        { 
          var f =_$("postform");
           f.submit();
        }
                  
                
	   
    </script>
    
    

<div class="layout-cols2">
<div class="col1">


   <%csharp%>TempUrl = ModuleCtrl.Header4("searchgroups","搜索圈子",false,false); <%/csharp%>
{TempUrl}
   <div class="content">
    <div id="search-links" class="searchbox">
	                
			        <label>选择搜索条件：</label>
                    <a href="#" id="lnk-location" name="location" onclick="swapTab('location');">圈子地区|</a>
                    <a href="#"id="lnk-age" name="group" onclick="swapTab('group');">圈子名|</a> 
                    <a href="#" id="lnk-age" name="disease" onclick="swapTab('disease');">圈子关联疾病</a> 
   
    </div>

    <div id="search-ui">
           <%csharp%>TempUrl="/Group/GroupListBySearch.aspx";<%/csharp%>
        <form  id="postform" method="get" action="{this.GetUrl(TempUrl)}" >

                    <div id="ui-location" style="display: block; float:left;">
                     圈子地区: 
                    省份
                    <select name="province" id="province"  onchange="if(this.value !='') setCity(this.options[this.selectedIndex].value)">
                 
                    <option value="">-不限-</option>  

                    <%csharp%>
                    foreach(DistrictInfo Info in ProvinceList)
                    {
                    <%/csharp%>
                    <option value="{Info.Id}">{Info.Name}</option>     
                    <%csharp%>
                    }
                    <%/csharp%>
                    </select>
                    城市
                    <select name="city" id ="city">
                    <option value ="">-不限-</option>
                    </select>
                    </div>
                    <div id="ui-group" style="display: none;float:left;">
                       圈子名：
                        <input type="text" id="groupname" name="name" length="20">
                    </div>
                    <div id="ui-disease" style="display: none;float:left;">
                        圈子关联疾病:
                        <select id="disease" name="dszid">
                            <option value="" selected>不限</option>
                            <%csharp%>
                            foreach( DiseaseInfo Info in DiseaseLst) {
                            <%/csharp%>
                            <option value="{Info.Id}">{Info.Name}</option>
                            <%csharp%>
                            }
                            <%/csharp%>
                        </select>
                    </div>

                  
                &nbsp;&nbsp; <input id="post" type="button" value="搜索" onclick="checkform()" class="button" />
                    <%csharp%>TempUrl = "/User/Group/Create.aspx"; <%/csharp%>   
                  <a href="{this.GetUrl(TempUrl)}" class="button" style="margin-left:100px;">创建圈子</a>
              
        </form>
        
    </div> 
    </div>

<%csharp%>TempUrl = ModuleCtrl.Footer("searchgroups"); <%/csharp%>
{TempUrl} 


<%template _groupmenu1%>

<div style="clear:both;"></div>

<div class="box">  
 
<div class="grouplist" id="mygroups">
<%csharp%>
    int n = 0;
    foreach(GroupInfo item in GroupListByUser) { 
    
<%/csharp%> 
    <%csharp%>if(n > 0 && n % 3 == 0) { <%/csharp%>        
        <div class="line"></div>
    <%csharp%> } <%/csharp%>
    <div class="groupbox">
        <%csharp%>TempUrl = "/Group/Group.aspx?gid=" + item.Id;<%/csharp%>
        <a href="{this.GetUrl(TempUrl)}" target="_blank">
            <img class="pic" src="{item.Logo}" />
        </a>
        <dl>
            <dd><strong>
            <%csharp%>TempUrl = "/Group/Group.aspx?gid=" + item.Id;<%/csharp%>
            <a href="{this.GetUrl(TempUrl)}" target="_blank">
                <%csharp%>if(item.GroupName.Length<=8){<%/csharp%>
                {item.GroupName}
                <%csharp%>}else{ string sb=item.GroupName.Substring(0,8)+"...";<%/csharp%>
                {sb}
                <%csharp%>}<%/csharp%>
            
            </a>
            </strong><em>({item.UserNum}人)</em></dd>
            
            <dd>帖子数：{item.PostNum} &nbsp;&nbsp; 点击量：{item.Hits}</dd>
                
            <dt>
                <a href="{this.GetUrl(TempUrl)}" target="_blank">角色:
                <%csharp%>if(item.Role==0){<%/csharp%>普通成员<%csharp%>}<%/csharp%>
                <%csharp%>if(item.Role==1){<%/csharp%>管理员<%csharp%>}<%/csharp%>
                <%csharp%>if(item.Role==2){<%/csharp%>圈主<%csharp%>}<%/csharp%>
                
                </a>
            </dt>
      
        </dl>
    </div>
<%csharp%> n++; } <%/csharp%>

<div style="clear:both;"></div>
		<div style="padding:10px;">
			<div class="pages">
				{PagingString}
			</div>
		</div>
</div>
   
</div> 

</div>

 
<div class ="col2">
  
<%template _GroupLattest%> 
</div>
</div> 
<%template _footer%>